package com.ek.distmpl.dao.mapper;

import com.ek.distmpl.dao.model.Course;
import com.ek.distmpl.dao.model.CourseExample;
import com.ek.distmpl.dao.model.CourseWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface CourseMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=CourseSqlProvider.class, method="countByExample")
    long countByExample(CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @DeleteProvider(type=CourseSqlProvider.class, method="deleteByExample")
    int deleteByExample(CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Delete({
        "delete from course",
        "where course_cid = #{courseCid,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String courseCid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Insert({
        "insert into course (course_cid, ccourse_hid, ",
        "course_uid, coursename, ",
        "course_picname, udef, ",
        "course_limit, course_left, ",
        "period, pcost, ptime, ",
        "course_commstar, course_status, ",
        "coursedescr, course_cpic)",
        "values (#{courseCid,jdbcType=CHAR}, #{ccourseHid,jdbcType=CHAR}, ",
        "#{courseUid,jdbcType=CHAR}, #{coursename,jdbcType=VARCHAR}, ",
        "#{coursePicname,jdbcType=VARCHAR}, #{udef,jdbcType=BIT}, ",
        "#{courseLimit,jdbcType=INTEGER}, #{courseLeft,jdbcType=INTEGER}, ",
        "#{period,jdbcType=INTEGER}, #{pcost,jdbcType=DOUBLE}, #{ptime,jdbcType=VARCHAR}, ",
        "#{courseCommstar,jdbcType=DOUBLE}, #{courseStatus,jdbcType=INTEGER}, ",
        "#{coursedescr,jdbcType=LONGVARCHAR}, #{courseCpic,jdbcType=LONGVARBINARY})"
    })
    int insert(CourseWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @InsertProvider(type=CourseSqlProvider.class, method="insertSelective")
    int insertSelective(CourseWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=CourseSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="course_cid", property="courseCid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="ccourse_hid", property="ccourseHid", jdbcType=JdbcType.CHAR),
        @Result(column="course_uid", property="courseUid", jdbcType=JdbcType.CHAR),
        @Result(column="coursename", property="coursename", jdbcType=JdbcType.VARCHAR),
        @Result(column="course_picname", property="coursePicname", jdbcType=JdbcType.VARCHAR),
        @Result(column="udef", property="udef", jdbcType=JdbcType.BIT),
        @Result(column="course_limit", property="courseLimit", jdbcType=JdbcType.INTEGER),
        @Result(column="course_left", property="courseLeft", jdbcType=JdbcType.INTEGER),
        @Result(column="period", property="period", jdbcType=JdbcType.INTEGER),
        @Result(column="pcost", property="pcost", jdbcType=JdbcType.DOUBLE),
        @Result(column="ptime", property="ptime", jdbcType=JdbcType.VARCHAR),
        @Result(column="course_commstar", property="courseCommstar", jdbcType=JdbcType.DOUBLE),
        @Result(column="course_status", property="courseStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="coursedescr", property="coursedescr", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="course_cpic", property="courseCpic", jdbcType=JdbcType.LONGVARBINARY)
    })
    List<CourseWithBLOBs> selectByExampleWithBLOBs(CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=CourseSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="course_cid", property="courseCid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="ccourse_hid", property="ccourseHid", jdbcType=JdbcType.CHAR),
        @Result(column="course_uid", property="courseUid", jdbcType=JdbcType.CHAR),
        @Result(column="coursename", property="coursename", jdbcType=JdbcType.VARCHAR),
        @Result(column="course_picname", property="coursePicname", jdbcType=JdbcType.VARCHAR),
        @Result(column="udef", property="udef", jdbcType=JdbcType.BIT),
        @Result(column="course_limit", property="courseLimit", jdbcType=JdbcType.INTEGER),
        @Result(column="course_left", property="courseLeft", jdbcType=JdbcType.INTEGER),
        @Result(column="period", property="period", jdbcType=JdbcType.INTEGER),
        @Result(column="pcost", property="pcost", jdbcType=JdbcType.DOUBLE),
        @Result(column="ptime", property="ptime", jdbcType=JdbcType.VARCHAR),
        @Result(column="course_commstar", property="courseCommstar", jdbcType=JdbcType.DOUBLE),
        @Result(column="course_status", property="courseStatus", jdbcType=JdbcType.INTEGER)
    })
    List<Course> selectByExample(CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Select({
        "select",
        "course_cid, ccourse_hid, course_uid, coursename, course_picname, udef, course_limit, ",
        "course_left, period, pcost, ptime, course_commstar, course_status, coursedescr, ",
        "course_cpic",
        "from course",
        "where course_cid = #{courseCid,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="course_cid", property="courseCid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="ccourse_hid", property="ccourseHid", jdbcType=JdbcType.CHAR),
        @Result(column="course_uid", property="courseUid", jdbcType=JdbcType.CHAR),
        @Result(column="coursename", property="coursename", jdbcType=JdbcType.VARCHAR),
        @Result(column="course_picname", property="coursePicname", jdbcType=JdbcType.VARCHAR),
        @Result(column="udef", property="udef", jdbcType=JdbcType.BIT),
        @Result(column="course_limit", property="courseLimit", jdbcType=JdbcType.INTEGER),
        @Result(column="course_left", property="courseLeft", jdbcType=JdbcType.INTEGER),
        @Result(column="period", property="period", jdbcType=JdbcType.INTEGER),
        @Result(column="pcost", property="pcost", jdbcType=JdbcType.DOUBLE),
        @Result(column="ptime", property="ptime", jdbcType=JdbcType.VARCHAR),
        @Result(column="course_commstar", property="courseCommstar", jdbcType=JdbcType.DOUBLE),
        @Result(column="course_status", property="courseStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="coursedescr", property="coursedescr", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="course_cpic", property="courseCpic", jdbcType=JdbcType.LONGVARBINARY)
    })
    CourseWithBLOBs selectByPrimaryKey(String courseCid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=CourseSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CourseWithBLOBs record, @Param("example") CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=CourseSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") CourseWithBLOBs record, @Param("example") CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=CourseSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Course record, @Param("example") CourseExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=CourseSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CourseWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Update({
        "update course",
        "set ccourse_hid = #{ccourseHid,jdbcType=CHAR},",
          "course_uid = #{courseUid,jdbcType=CHAR},",
          "coursename = #{coursename,jdbcType=VARCHAR},",
          "course_picname = #{coursePicname,jdbcType=VARCHAR},",
          "udef = #{udef,jdbcType=BIT},",
          "course_limit = #{courseLimit,jdbcType=INTEGER},",
          "course_left = #{courseLeft,jdbcType=INTEGER},",
          "period = #{period,jdbcType=INTEGER},",
          "pcost = #{pcost,jdbcType=DOUBLE},",
          "ptime = #{ptime,jdbcType=VARCHAR},",
          "course_commstar = #{courseCommstar,jdbcType=DOUBLE},",
          "course_status = #{courseStatus,jdbcType=INTEGER},",
          "coursedescr = #{coursedescr,jdbcType=LONGVARCHAR},",
          "course_cpic = #{courseCpic,jdbcType=LONGVARBINARY}",
        "where course_cid = #{courseCid,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(CourseWithBLOBs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table course
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Update({
        "update course",
        "set ccourse_hid = #{ccourseHid,jdbcType=CHAR},",
          "course_uid = #{courseUid,jdbcType=CHAR},",
          "coursename = #{coursename,jdbcType=VARCHAR},",
          "course_picname = #{coursePicname,jdbcType=VARCHAR},",
          "udef = #{udef,jdbcType=BIT},",
          "course_limit = #{courseLimit,jdbcType=INTEGER},",
          "course_left = #{courseLeft,jdbcType=INTEGER},",
          "period = #{period,jdbcType=INTEGER},",
          "pcost = #{pcost,jdbcType=DOUBLE},",
          "ptime = #{ptime,jdbcType=VARCHAR},",
          "course_commstar = #{courseCommstar,jdbcType=DOUBLE},",
          "course_status = #{courseStatus,jdbcType=INTEGER}",
        "where course_cid = #{courseCid,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Course record);
}